package com.electron.power.aio.mod.client;

import org.smartboot.socket.MessageProcessor;
import org.smartboot.socket.StateMachineEnum;
import org.smartboot.socket.transport.AioSession;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ModClientProcessor implements MessageProcessor<String>{
	private AioSession<String> session;

    @Override
    public void process(AioSession<String> session, String msg) {
        System.out.println("接受到服务端响应数据：" + msg);
    }
    

    @Override
    public void stateEvent(AioSession<String> session, StateMachineEnum stateMachineEnum, Throwable throwable) {
        switch (stateMachineEnum) {
            case NEW_SESSION:
                this.session = session;
                break;
            default:
                log.info("other state:" + stateMachineEnum);
        }

    }

    public AioSession<String> getSession() {
        return session;
    }
}
